package c.c.k.repository;

import c.c.k.pojo.Stock;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by chenck on 2022/3/19.
 */
@Repository
public interface StockRepository extends JpaRepository<Stock, Long> {
    Stock findByCode(String code);

    List<Stock> findByJys(String jys);

    @Query("select s from Stock s  where s.shiZhi>?1 and s.shiZhi<?2 and s.jys=?3 order by s.nowPrice/s.maxPrice")
    List<Stock> listStockByPercent(Double minShizhi, Double maxShiZhi, String jys);
}
